home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / rmdir.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  887 b   |  40 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "dosdos.h"
  12.  
  13. //
  14. //    Remove a directory
  15. //
  16. USHORT _APICALL
  17. DosRmdir    ( const char far *DirName, unsigned long Reserved )
  18. {
  19.     asm push ds ;
  20.     _DS = FP_SEG(DirName) ;
  21.     _DX = FP_OFF(DirName) ;
  22.     _AH = 0x3a ;
  23.     Dos3Call() ;
  24.     asm pop ds ;
  25.     if (_FLAGS & 0x0001) {
  26.         if (_AX != ERROR_CURRENT_DIRECTORY) return _AX ;
  27.  
  28.         //
  29.         // Special case for wildcards
  30.         //
  31.         while (*DirName)
  32.             if (*DirName == '?' || *DirName == '*')
  33.                 return ERROR_PATH_NOT_FOUND ;
  34.             else
  35.                 DirName++ ;
  36.         return ERROR_CURRENT_DIRECTORY;
  37.     }
  38.     return NO_ERROR ;
  39. }
  40.